#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
char mynum2hex(int yu)
{
	char num=0;
	if (yu >= 0 && yu <= 9)
	{
		num = yu + '0';
	}
	if (yu >= 10 && yu <= 15)
	{
		switch (yu)
		{
		case 10:
			num = 'A';
			break;
		case 11:
			num = 'B';
			break;
		case 12:
			num = 'C';
			break;
		case 13:
			num = 'D';
			break;
		case 14:
			num = 'E';
			break;
		case 15:
		   num = 'F';
		   break;

		}
	}
	return num;

}
int main()
{
	int dec, tmp, yushu, i,len=0;
	char hex[8];
	scanf("%d", &dec);
	tmp = dec;
	while (tmp != 0)
	{
		yushu = tmp % 16;
		hex[len] = mynum2hex(yushu);
		len++;
		tmp = tmp / 16;
	}
	for (i = len; i >= 0; i--)
	{
		if (hex[i] == '0')
	     continue;
		printf("%c", hex[i]);
	}
	return 0;

}